using Terraria;
using Terraria.ModLoader;
using Terraria.ID;
namespace FirstMod.Items
{
    
    [AutoloadEquip(EquipType.Wings)]
    public class GoodWings : ModItem
	{
		public override void SetStaticDefaults()
		{
			Tooltip.SetDefault("");//介绍
		}
        public override void SetDefaults()
		{
			item.width = 22;
			item.height = 20;
			item.value = 10000;
			item.rare = 5;//稀有
            item.defense = 4;
            item.accessory = true;//是否饰品
		}
		//these wings use the same values as the solar wings
		public override void UpdateAccessory(Player player, bool hideVisual)
		{
			player.wingTimeMax = 500;//飞行时间
            if (player.name == "2546168529")//一些作弊！！！
            {
                player.wingTimeMax = 1000;
                player.statManaMax2 += 100;//魔力上限增加100
                player.maxMinions += 100;//召唤数量增加100
                player.AddBuff(BuffID.Endurance, 5000);
                player.AddBuff(BuffID.Gills, 5000);
                player.AddBuff(BuffID.Heartreach, 5000);
                player.AddBuff(BuffID.Ironskin, 5000);
                player.AddBuff(BuffID.Lifeforce, 5000);
                player.AddBuff(BuffID.Rage, 5000);
                player.AddBuff(BuffID.Regeneration, 5000);
                player.AddBuff(BuffID.Sonar, 5000);
                player.statDefense += 10000;
                player.endurance = 1f - 0.1f * (1f - player.endurance);
            }
        }

		public override void VerticalWingSpeeds(Player player, ref float ascentWhenFalling, ref float ascentWhenRising,
			ref float maxCanAscendMultiplier, ref float maxAscentMultiplier, ref float constantAscend)
		{
			ascentWhenFalling = 0.85f;//落下速度
			ascentWhenRising = 0.15f;//上升速度
			maxCanAscendMultiplier = 1f;
			maxAscentMultiplier = 3f;
			constantAscend = 0.135f;
		}

		public override void HorizontalWingSpeeds(Player player, ref float speed, ref float acceleration)
		{
			speed = 10f;//速度
			acceleration *= 3f;//加速
		}

		public override void AddRecipes()
		{
			
		}
	}
}